﻿using System;
using System.Collections.Generic;

using Web.Generics;

using BolaoDNA.DomainModel;
using BolaoDNA.Repositories;

namespace BolaoDNA.Services
{
	public class PalpiteService : GenericService<Palpite> {
		private readonly IPalpiteRepository repository;
		public PalpiteService(IPalpiteRepository repository, ILogger logger) : base(repository, logger)
		{
			this.repository = repository;
		}

        public IList<Palpite> Select(int idInscricaoBolao, int idJogo)
        {
            return repository.Select(new FilterParameters
            {
                FilterConditions = new[] {
                    new FilterCondition { Property="InscricaoBolao.ID", Comparer=FilterCondition.ComparerType.eq, Value=idInscricaoBolao },
                    new FilterCondition { Property="Jogo.ID", Comparer=FilterCondition.ComparerType.eq, Value=idJogo }
                }
            });
        }
    }
}
